package com.sc.nft.entity.vo.mall;

import com.google.common.collect.Lists;
import com.sc.nft.enums.MallOrderRefundStatusEnum;
import com.sc.nft.enums.MallOrderStatusEnum;
import com.sc.nft.enums.task.ActivityTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class PageMallOrderVO {


    @ApiModelProperty("订单id")
    private Long id;

    @ApiModelProperty("品牌名称")
    private String daoName;

    @ApiModelProperty("实付款")
    private String realPrice;

    @ApiModelProperty("订单号")
    private String orderNo;

    @ApiModelProperty("品牌id")
    private Long daoId;

    @ApiModelProperty("订单类型 : SALES:销售订单  EXCHANGE:兑换订单")
    private ActivityTypeEnum activityType;

    @ApiModelProperty("快递单号  等于0为发货 不等于0可查物流信息")
    private String deliveryNo;

    @ApiModelProperty("订单状态 TIMEOUT_CANCEL:超时取消 WAIT_PAY:待付款 WAIT_RECEIPT:待发货 TO_BE_RECEIPT:待收货(显示确认实收货) RECEIPT:已收货(显示确认实收货) FINISH:已完成")
    private MallOrderStatusEnum status;

    @ApiModelProperty("退款状态 NOT_APPLY:未申请  APPLYING:申请中(商家处理中)  REFUSE_REFUND:商家拒绝退款  REFUNDING:退款中  REFUND_SUCCES:已退款(退款成功)")
    private MallOrderRefundStatusEnum refundStatus;

    @ApiModelProperty("是否售后中")
    private Boolean isAfterSale;

    @ApiModelProperty("商品列表")
    private List<MallOrderProductDetailsVO> productList = Lists.newArrayList();

    /**
     * 是否为虚拟商品订单
     */
    @ApiModelProperty("是否为虚拟商品订单")
    private Boolean isVirtual;

    /**
     * 订单状态:success：成功，processing：处理中，failed：失败，untreated：未处理
     */
    @ApiModelProperty("订单状态:success：成功，processing：处理中，failed：失败，untreated：未处理")
    private String apiOrderState;

    public void setPayPrice(BigDecimal realPrice) {
        this.realPrice = realPrice.setScale(2,BigDecimal.ROUND_DOWN).toPlainString();
    }
}
